{% extends "layouts/baseview.html" %}
{% load i18n %}
{% load short_uri %}

{%block title%}edit wiki{%endblock%}

{% block stylesheet %}
<link rel="stylesheet" href="/css/code-min.css" />
{% endblock %}

{%block ready_js%}

$('#btn_save').click(function (){
    $('#edit_wiki_form input[name="do"]').val('save');
    $('#edit_wiki_form').submit();	
});    

$('#btn_preview').click(function (){
    $('#edit_wiki_form input[name="do"]').val('preview');
    $('#edit_wiki_form').submit();	
});    

{%endblock%}

{%block main-block%}
<div class="d-p-project-content d-p-project-document">
		<div class="bulid-wiki">
		    <h2>
			   <a href="/p/taobaocode/wiki/WikiFormatting/" target="_blank">{%trans "See Wiki Formats"%} </a>
		    </h2>		
		    <form id="edit_wiki_form" action="" method="POST">
		    {% csrf_token %}
		    <textarea id="wiki" name="content" class="text">{{ content}}</textarea>
		    <p>
		      <input type="hidden" name="do"/>      
		      <a href="javascript:;" id="btn_save" class="p-p-project-btn btn">{%trans "Save"%}</a>
		      <a href="javascript:;" id="btn_preview" class="p-p-project-btn btn" style="margin-left:50px;">{%trans "Preview"%}</a>
		    </p>
		   </form>
		  
		  {%if preview%}
		  <p id="preview">
		    <h4>Preview</h4>
		    <div class="preview">
		      {{preview|wikitext:wiki}}
		    </div>
		  </p>
		  {%endif%}
		</div>




</div>

{%endblock%}
